package reflection.dproxy.delegate;

import java.lang.reflect.Proxy;

import reflection.dproxy.debugproxy.BazException;
import reflection.dproxy.debugproxy.Foo;
import reflection.dproxy.debugproxy.FooImpl;


public class Main {

	/**
	 * @param args
	 * @throws BazException 
	 */
	public static void main(String[] args) throws BazException {
		Class[] proxyInterfaces = new Class[] { Foo.class, Foo1.class };
		
		Foo foo = (Foo) Proxy.newProxyInstance(Foo.class.getClassLoader(),
				proxyInterfaces, new Delegator(proxyInterfaces,
				new Object[] { new FooImpl(), new Foo1Impl() }));
		
		foo.bar(null);
		System.out.println(foo.toString());
		System.out.println(foo.equals(null));
	}
}
